package com.makinolo.rlvforge.tacx.data
{
import flash.utils.ByteArray;
	
public class InfoBlock implements Persistent
{
	// Constants
	public static const LAP_DATA:int = 110;
	public static const NOTES:int = 120;
	public static const UNK1_RLV:int = 130;
	public static const RIDER_INFO:int = 210;
	public static const GENERAL_INFO:int = 1010;
	public static const PROGRAM_DETAILS:int = 1020;
	public static const RLV_VIDEO_INFO:int = 2010;
	public static const RLV_FRAME_DISTANCE_MAPPING:int = 2020;
	public static const RLV_INFOBOX:int = 2030;
	public static const COURSE_INFO:int = 2040;
	public static const RIDE_INFO:int = 3010;
	public static const RIDE_DATA:int = 3020;
	public static const VR_GENERAL_INFO:int = 4010;
	public static const VR_COURSE_DATA:int = 4020;
	public static const VR_RIDE_INFO:int = 4030;
	public static const VR_RIDE_DATA:int = 4040;
	public static const RLV_MULTICOURSE_INFO:int = 6010;
	public static const RLV_ITEMMULTISECT:int = 6020;
	
	private var BlockFingerprint:int;//(Unsigned Short) Identifies the data to follow
	private var BlockVersion:int;	 //(Unsigned Short) A 3 digit number indicating the block version, e.g. 100 or 110
	private var RecordCount:int;	 // Number of records in the block
	private var RecordSize:int;		//Size of each record in the block
	
	public function InfoBlock( bf:int,  bv:int,  rc:int,  s:int) 
	{
		BlockFingerprint = bf;
		BlockVersion = bv;
		RecordCount = rc;
		RecordSize = s;
	}

	public function getBlockFingerprint():int
	{
		return BlockFingerprint;
	}

	public function setBlockFingerprint( blockFingerprint:int):void
	{
		BlockFingerprint = blockFingerprint;
	}

	public function getBlockVersion():int
	{
		return BlockVersion;
	}

	public function setBlockVersion(blockVersion:int):void
	{
		BlockVersion = blockVersion;
	}

	public function getRecordCount():int
	{
		return RecordCount;
	}

	public function setRecordCount(recordCount:int):void
	{
		RecordCount = recordCount;
	}

	public function getRecordSize():int
	{
		return RecordSize;
	}

	public function setRecordSize(recordSize:int):void
	{
		RecordSize = recordSize;
	}
	
	public function persist(dos:ByteArray):void
	{
		dos.writeShort(BlockFingerprint);
		dos.writeShort(BlockVersion);
		dos.writeInt(RecordCount);
		dos.writeInt(RecordSize);
	}
	
}

}